/*
 * Copyright (c) 18/5/25 . All Rights Reserved.
 */
package com.cgmnx.admin.web.converter.entity;

import com.cgmnx.admin.dao.condition.ReplyCondition;
import com.cgmnx.admin.dao.entity.ReplyEntity;
import com.cgmnx.admin.model.enums.ReplyAuditStatus;
import com.cgmnx.admin.web.converter.Convert;
import com.cgmnx.admin.web.model.param.ReplyQueryParam;
import com.cgmnx.admin.web.model.param.ReplySaveParam;
import org.springframework.stereotype.Component;

import java.util.Date;
import java.util.List;

import static com.cgmnx.admin.model.enums.ReplyAuditStatus.UN_AUDIT;

/**
 * @author: z Date: 18/5/25 Time: 下午5:09
 * @version: 1.0.0
 */
@Component
public class ReplyEntryConverter implements Convert<ReplySaveParam,ReplyEntity> {

    @Override
    public ReplyEntity convert(ReplySaveParam t) {
        ReplyEntity entity = new ReplyEntity();
        entity.setUserId(1L);
        entity.setStatus(UN_AUDIT);
        entity.setNoteId(t.getNoteId());
        entity.setReplyUserId(t.getReplyUserId());
        entity.setUserName(t.getUserName());
        entity.setUserId(t.getUserId());
        entity.setContent(t.getContent());
        entity.setTierNum(t.getTierNum());
        entity.setLikeNum(t.getLikeNum());
        entity.setCreateUser("dong.yang");
        entity.setUpdateUser("dong.yang");
        entity.setAuditTime(new Date());
        return entity;
    }

    @Override
    public List<ReplyEntity> convert(List<ReplySaveParam> t) {
        return null;
    }
}
